#include "mcsythread.h"

MCsyThread::MCsyThread():MCsy()
{
    m_test1=9.87653;
    thread1=new MyThread(this);
    connect(thread1, SIGNAL(dataAllFinish(CMySig*)),
            this, SLOT(updateData(CMySig*)));
    connect(thread1, SIGNAL(dataArrive(const QList<double>&)),
            this, SLOT(updateDataOne(const QList<double>&)));
}
MCsyThread::~MCsyThread()
{
    delete thread1;
}
void MCsyThread::start()
{
    thread1->start(QThread::HighPriority);
}
void MCsyThread::stop()
{
    if (thread1->isRunning())
    {
        thread1->stopProcess();
    }
    else
    {
        qDebug()<<"no";
    }
}
void MCsyThread::setCard(CCard* c)
{
    card=c;
}
void MCsyThread::updateData(CMySig *l)
{
    emit dataAllFinish(l);
    qDebug()<<"emit from mcsyThread";
}
void MCsyThread::updateDataOne(const QList<double> &l)
{
    emit dataArrive(l);
    qDebug()<<"emit dataarrive from mcsyThread";

}
